package org.csmzxy.class2333;

public class Example {
    public static void main(String[] args) {
        int[] arr = {1, 13, 2, 3, 8};
        for (int i = 0; i < arr.length - 1; i++) {
            if (arr[i] > arr[i + 1]) {
                int tmp = arr[i];
                arr[i] = arr[i + 1];
                arr[i + 1] = tmp;
            }
        }
        System.out.println(arr[arr.length - 1]);

        int max = arr[0];
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] > max) {
                max = arr[i];
            }
        }
        System.out.println("最大值：" + max);
    }
}
